<template>
  <el-dialog
    v-model="dialogVisible"
    title="查找病人"
    :width="600"
    :before-close="handleClose"
  >
    <el-form
      :inline="true"
      :model="formInline"
      label-width="auto"
      :label-position="'Right'"
      class="demo-form-inline"
    >
      <el-form-item label="姓名:">
        <el-input
          v-model="formInline.user"
          placeholder="请输入姓名"
          clearable
        />
      </el-form-item>
      <el-form-item label="门诊号:">
        <el-input v-model="formInline.num" placeholder=""></el-input>
      </el-form-item>

      <el-form-item label="年龄:">
        <s-select :options="[]" style="width: 139px"></s-select>
      </el-form-item>
      <el-form-item v-model="formInline.region" label="性别:">
        <s-select :options="[]" style="width: 139px"></s-select>
      </el-form-item>
      <el-form-item label="身份证号:">
        <el-input
          v-model="formInline.user"
          placeholder="请输入身份证号"
          clearable
        />
      </el-form-item>
      <el-form-item label="就诊卡号:">
        <el-input
          v-model="formInline.user"
          placeholder="请输入就诊卡号"
          clearable
        />
      </el-form-item>
      <el-form-item label="上次就诊:">
        <el-date-picker
          v-model="formInline.dates"
          type="daterange"
          range-separator="至"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
          :size="size"
        />
      </el-form-item>
    </el-form>
    <el-button class="mb12" pain @click="isOk"> 查找 </el-button>
    <s-table></s-table>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="isOk"> 确定 </el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup lang="ts">
import { useDialog } from "@common/src/hooks/dialog.ts";

const props = withDefaults(
  defineProps<{
    modelValue: boolean;
    params?: Object;
  }>(),
  {
    modelValue: false,
    params: () => {},
  }
);
const formInline = reactive({
  user: "",
  region: "",
  date: "",
  num: "",
  dates: "",
});

const onSubmit = () => {
  console.log("submit!");
};
const emit = defineEmits(["update:modelValue"]);

const { handleClose, dialogVisible } = useDialog(props, emit);
</script>

<style lang="scss" scoped>
</style>
